<?

include_once "../conn.php";

include_once "accesscontrol.php";


if(isset($submit) && $submit =  "Login" )
{
$q = "select * from job_post where job_id = \"$_POST[job_id]\" ";
$r = mysql_query($q) or die(mysql_error());
$a = mysql_fetch_array($r);

$nv = $a[nv] + 1;

$qn = "update job_post set nv = \"$nv\" where job_id = \"$_POST[job_id]\" ";
$rn = mysql_query($qn) or die(mysql_error());

$js = $_POST[job_id];
}
else
{
$q = "select * from job_post where job_id = \"$_GET[job_id]\" ";
$r = mysql_query($q) or die(mysql_error());
$a = mysql_fetch_array($r);

$time = strtotime($a['createdTime']);
$dateAdd = date("d F Y" ,$time);
$day = date(d);
$month = date(m);
$year = date(Y);

$EXdate = "$a[EXyear]"."-"."$a[EXmonth]"."-"."$a[EXday]";
$dnes = "$year"."-"."$month"."-"."$day";

$qd = "select to_days('$EXdate') - to_days('$dnes')";
$rqd = mysql_query($qd) or die(mysql_error());
$ex13 = mysql_fetch_array($rqd);
$date = mktime(0, 0, 0, date("m"), date("d")+$ex13[0], date("y"));
$expired = date("d F Y", $date);
$nv = $a[nv] + 1;

$qn = "update job_post set nv = \"$nv\" where job_id = \"$_GET[job_id]\" ";
$rn = mysql_query($qn) or die(mysql_error());

$js = $_GET[job_id];
}
$q2 = "select * from job_employer_info where ename = \"$a[ename]\"";
$r2 = mysql_query($q2) or die(mysql_error());
$a2 = mysql_fetch_array($r2);

$respond1 = nl2br($a[responsibilities]);
$require1 = nl2br($a[requirements]);

$respond = str_replace("<br />", "<br />*", $respond1);
$require = str_replace("<br />", "<br />*", $require1);

$show_category = str_replace("|", ", ", $a[JobCategory]);
?>

<br>
<table align=center border=1 bordercolor=993300 cellspacing=0 width=460>
	<tr>
		<td>
			<center>
				<br>
				<br>
				<font size=4><?=$a2['CompanyName']?></font><br>
				<img src="../employers/re_images/<?=$a2['CompanyLogo']?>" width="150" height="200">
			</center>	

				<table align=center width=550 class=BlackText border=0>
					<tr>
						<td>
							
							<table border=0 align=center width=520>
								<tr align=right>
									<td><b> Advertised: </b><?=$dateAdd?><br>
											<b>	Closing Date: </b><?=$expired?><br><br><br>
									</td>
								</tr>

								<tr>
									<td> <?=$a2[CompanyProfile]?> </td>
								</tr>

								<tr>
									<td> We pay good package financially and promising corporate rewards if you prove to be committed to make the world different. Join us today!</td>
								</tr>

								<tr>
									<td align=center><font size=5 color=blue><?=$a[position]?></font></td>
								</tr>

								<tr>
									<td align=center>( <?=$a[CompanyState]?> )<br><br></td>
								</tr>

								<tr>
									<td><b>Responsibilities:</b></td>
								</tr>
		
								<tr>
									<td>* <?=$respond?><br><br></td>
								</tr>

								<tr>
									<td><b>Requirements:</b></td>
								</tr>

								<tr>
									<td>* <?=$require?><br><br></td>
								</tr>

							<form action=Send.php method=post>
								<tr>
									<td colspan=2 align=center>
										<input type=hidden name=job_id value=<?=$a[job_id]?>>
										<input type=hidden name=ename value=<?=$a[ename]?>>
										<input type=submit name=ok value="Click Here to Apply"><br><br>
										<input type=submit name=friend value="Send to a friend"><br><br>
									</td>
								</tr>
								<tr>
								<td>
									<img src="../icon/info.gif"> <a href="companyInfo.php?&cname=<?=$a2['CompanyName']?>&name=<?=$a[ename]?>">Company Information</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									<img src="../icon/similarjobs.gif"> <a href="similarJob.php?cat=<?=$a[JobCategory]?>">View Similar Jobs</a>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
	  							<img src="../icon/alljobs.gif"> <a href="alljob.php?&cname=<?=$a2['CompanyName']?>&name=<?=$a[ename]?>">All Jobs From Company</a>   
							</form>
							</table>
						</td>
					</tr>
				</table>
		</td>
	</tr>
</table>
<? include_once('../footer.php'); ?>